package com.isoft.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.isoft.dao.StopBoardingDao;
import com.isoft.entity.PageBean;
import com.isoft.entity.StopBoarding;
import com.isoft.entity.UrgeBoarding;
import com.isoft.service.IStopBoardingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StopBoardingService implements IStopBoardingService {
    @Autowired
    private StopBoardingDao stopBoardingDao;

    @Override
    public PageBean selectStopBoarding(Integer page , Integer pageSize) {
        PageHelper.startPage(page, pageSize);
        List<StopBoarding> stopBoardingList = stopBoardingDao.selectStopBoarding();
        Page<StopBoarding> p = (Page<StopBoarding>) stopBoardingList;
        PageBean pageBean = new PageBean((int) p.getTotal(), p.getResult());
        return pageBean;
    }
}
